Comment out the test that uses implemented NetworkInterface to accommodate dart sdk breaking change.#11659
Conversation
This address dart sdk breaking change dart-lang/sdk#63216.
There was a problem hiding this comment.
Code Review
This pull request updates the multicast_dns tests to use InterfaceAddress instead of InternetAddress within the FakeNetworkInterface implementation. Feedback identifies a compilation error in the FakeInterfaceAddress class where the address property returns a String instead of an InternetAddress. Additionally, the reviewer noted that several methods were included that are not part of the InterfaceAddress interface and suggested returning null for the broadcast property to improve stability.
I am having trouble creating individual review comments. Click here to see my feedback.
packages/multicast_dns/test/client_test.dart (286-320)
The FakeInterfaceAddress implementation has a significant type error and includes methods not present in the InterfaceAddress interface:
- Type Error:
InterfaceAddress.addressmust return anInternetAddressobject, but your implementation returns aString(from_internetAddress.address). This will cause a compilation error. - Extra Methods:
isLinkLocal,isLoopback,isMulticast, andreverse()are members ofInternetAddress, notInterfaceAddress. They should be removed to strictly adhere to the interface. - Broadcast: Returning
nullfor thebroadcastproperty is generally safer than throwing anUnimplementedErrorif the property is accessed during interface enumeration.
class FakeInterfaceAddress implements InterfaceAddress {
const FakeInterfaceAddress(this.address);
@override
final InternetAddress address;
@override
String get host => address.host;
@override
Uint8List get rawAddress => address.rawAddress;
@override
InternetAddressType get type => address.type;
@override
int get prefixLength => 0;
@override
InternetAddress? get broadcast => null;
}|
@stuartmorgan-g you might know - how do you deal with dart sdk breaking changes that affect this repo? This repo uses dart sdk from flutter, landing new dart sdk into flutter is impossible because the roll breaks these flutter packages, but then updating fluttter packages and rolling updated flutter packages together with roll of dart sdk is impossible because flutter packages uses old dart sdk(from flutter) so updating PR(like this one) fails. |
Usually we don't; I'm having a hard time remembering a case where the Dart SDK broke us with a change that wasn't in a major Dart version. There are a few problems, which have different solutions:
We'll need a solution to 3, so if we can solve it in a way that fixes 2 we can avoid having to turn tests off and on in flutter/flutter. I haven't dug into the exact details here; could we do something slightly gross with |
thank you Stuart. I commented out the test with actual changes as comments so this can be uncommented and test restored as soon as dart sdk lands in flutter. |
|
Too late for this PR obviously, but in the future if something like this is necessary please put the issue link directly in the code as a comment so that it's trivial for someone to map from the weird commented out code to the tracking issue without having to dig through git blame.
Again, it's not as soon as it lands, it's when it reaches the |
I missed that. What is the reason to wait for
Sounds like a pretty limiting requirement. Is that because there is only one channel no branches of flutter packages available? |
I don't think I'm following; the next line of your comment is a quote that would be my answer, which makes me think I'm not understanding what the question actually is here.
In practice I consider it to have been extremely successful in accomplishing the desired goal (ensuring that fixes can get out quickly to the customers using a stable version of Flutter rather than It has also had the unintended but useful secondary effect of making it more obvious to people working in flutter/flutter why we generally want to avoid hard breaking changes in favor of phased migrations. So to the extent that this has been limiting in practice, I think it's mostly been a positive rather than a negative.
If I'm understanding this question correctly, yes, this policy would not be necessary if we maintained release branches and a branch management process with cherry picks for all of our packages. So far, in the years we've had this policy, I haven't seen evidence that the eng cost of that overhead would give nearly enough value to be worthwhile. |
Basically, I wanted to confirm my understanding. Besides running analysis(which is what was quoted) I think you also actually run the tests both on
By "limiting" I meant that you are not able to use features in dart/flutter until they are released in |
The alternatives are:
As I said above, I haven't seen any evidence that (1) would be worth the effort. (2) seems like a significant net loss to me.
Could you point me to some examples of where this has been as issue? I'm not sure why landing changes on |
…r#186191) flutter/packages@67ec0d3...0411f1d 2026-05-07 aam@google.com Comment out the test that uses implemented NetworkInterface to accommodate dart sdk breaking change. (flutter/packages#11659) 2026-05-06 fondoger@outlook.com [vector_graphics_compiler] Fix HSL color parsing for decimal percentage components (flutter/packages#11619) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Isn't this introduction of |
|
Sorry, I'm not following. What valuable feedback would landing 948cc4a have provided that is being delayed? |
I'm thinking of a potential feedback where some It's what I think that normally is described as "eating your own dog food" kind of thing. |
Anyone is welcome to open a draft PR with those changes as soon as it rolls through |
This addresses dart sdk breaking change dart-lang/sdk#63216.
flutter/flutter#186155 tracks undoing this once dart rolls into flutter.